package com.phone.store.exception;

import com.phone.store.vo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author fangyu
 * @version v1.0.0
 * @date 2020/8/1 4:36 下午
 */
@Slf4j
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {

    @ExceptionHandler(PhoneException.class)
    public ResultVO httpRequestMethodHandler(PhoneException exception) {
        return exception.getResultVO();
    }
}
